home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
prolog
/
ai.prl
/
dprolog.lha
/
switch.scr
< prev
Wrap
Text File
|
1991-03-05
|
1KB
|
62 lines
set take-echo off
set input echo off
set local off
if defined \%1 goto start
echo No resource defined on call to SWITCH\13\10
stop
:Start
echo \13\10 Waking up the switch\13\10
set count 5
:Loop1
pause
output \13
pause
input 5 resource:\7
if success goto awake
echo Trying again....\13\10
if count goto :Loop1
echo \13\10 Failed to connect to switch \13\10
goto Die
:Awake
echo \13\10 Trying to connect to resource \%1 \13\10
output \%1 \13
pause
set alarm 3600
:Loop2
reinput connected
if success pop
reinput not available
if success goto Label3
reinput waiting
if success goto Label4
reinput trying
if success goto Label4
reinput ??
if success goto Label5
reinput Password:
if success goto Label6
if not alarm goto Loop2
echo \13\10 Kermit timed out after 10 minutes of waiting for switch\13\10
goto Die
:Label3
echo \13\10 Switch announces "Not Available"\13\10
goto Die
:Label4
echo \13\10 Switch announces "Trying"\13\10
clear
goto Loop2
:Label5
echo \13\10 Switch announces "Resource has changed"\13\10
goto Die
:Label6
if defined \%2 goto Enterpw
echo \13\10 Switch requested Password and none defined\13\10
goto Die
:Enterpw
output \%2 \13
goto Loop2
:Die
drop
hangup ; error exit - hangup the phone and die...
stop